package com.gao.util;

import javax.naming.OperationNotSupportedException;

/**
 * @author gao
 * @date 2023/08/11 09:47:41
 */
public interface List<T> extends Collection<T> {
    boolean add(T obj);

    /**
     * @param index 要设置新值的索引位置
     * @param val   新值
     * @return 被替换的旧值
     */
    T set(int index, T val);

    boolean del(T val);

    T del(int index);

    T get(int index);

    Iterator<T> iterator();

    void reverse() throws OperationNotSupportedException;

    void reverseInGroup(int k) throws OperationNotSupportedException;

    void reverse(int start, int end) throws OperationNotSupportedException;

    int size();

}
